2.11 According to the full method specification in the Object class, any override of the Object class's equals method should satisfy the following five properties:
1. reflexivity, that is, for any non-null reference x,
x.equals (x)
should return true.
2. symmetry, that is, for any non-null references x and y,
x.equals (y)
should return the same result as
y.equals (x)
3. transitivity, that is, for any references x, y and z if
x.equals (y)
returns true, and
y.equals (z)
returns true, then
x.equals (z)
should return true.
4. consistency, that is, for any non-null references x and y, multiple invocations of
x.equals (y)
should consistently return true or consistently return false, provided no information used in equals
comparisons on the objects is modified.
5. actuality, that is, for any non-null reference x,
x.equals (null)
should return false.
For the FullTimeEmployee class's equals method (see Section 2.7), provide examples to support the
claim that the equals method satisfies those five properties. You are not being asked to prove that the
FullTimeEmployee class's equals method satisfies those properties.
 
 
View Solution
 
 
 
<< Back Next >>